package com.serviceprovider.business.module.sp.preferences.services;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.sp.preferences.dao.interfaces.IPreferencesDao;
import com.serviceprovider.business.module.sp.preferences.model.Preferences;
import com.serviceprovider.business.module.user.model.impl.User;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("preferencesService")
public class PreferencesService implements IPreferencesService {
    @Autowired
    private IPreferencesDao preferencesDao;

    @Override
    public Preferences findByUserId(int userId) {
        return preferencesDao.findByUserId(userId);
    }

    @Override
    public Preferences createPreferences(Preferences preferences) {
        return preferencesDao.createPreferences(preferences);
    }

    @Override
    public void updatePreferences(Preferences preferences) {
        preferencesDao.updatePreferences(preferences);
    }

    @Override
    public Preferences saveDefaultFee(User user, Integer fee) {
        return preferencesDao.saveDefaultFee(user, fee);
    }
}



